const {http} = require("../../utils/http")
Page({
    data:{
        musics:[]
    },
    onLoad:function(options){
        var url = `http://47.108.197.28:3000/top/playlist`;
        http({
            url,
            success:res=>{
                var musics = []
                console.log(res.data.playlists);
                var playlists = res.data.playlists;
                playlists.forEach(item =>{
                    var {name,coverImgUrl} =item;
                    musics.push({
                        coverImgUrl,
                        name
                    })
                })
                this.setData({
                    musics
                })
            }
        })
    },
    // handleClick(event){
    //     console.log(event.currentTarget.dataset)
    //     var {aid} = event.currentTarget.dataset
    //     wx.navigateTo({
    //         url:
    //     })
    // }
})
